import pandas as pd


class DataOperation:
    def __init__(self, path):
        self.data = pd.read_csv(f'{path}')

    def get_to_list(self, rows=None, rowe=None, columnss=None, columnse=None):
        list = self.data.iloc[rows:rowe, columnss:columnse].values.tolist()
        return list

    def get_to_dict(self, rows=None, rowe=None, columnss=None, columnse=None):
        list = []
        for i in range(rows, rowe):
            list.append(self.data.iloc[i, columnss:columnse].to_dict())
        return list


if __name__ == '__main__':
    case = DataOperation('../web/lj_data.csv')
    print(case.get_to_list(5, 6, 3, 5))
    print(case.get_to_dict(5, 10, 0, 2))
